package com.utils.messageFactory;

import com.entity.Dietitian;
import com.utils.MailHtmlUtils;
import com.vo.MailUser;

public class DietitianMessageFactory implements MakeMessage{
    public String[] getMessage(MailUser mailUser, String opDeatil){
        Dietitian dietitian = (Dietitian)mailUser;
        String subject = null;
        StringBuilder mailMessage = new StringBuilder();
        switch (opDeatil){
            case "add":
                mailMessage.append("亲爱的专家"+dietitian.getDname()+":<br>");
                mailMessage.append("注册成功");
                break;
            case "addOrder":
                mailMessage.append("亲爱的专家"+dietitian.getDname()+":<br>");
                mailMessage.append("下单成功,购买专家");

                mailMessage.append("");
                subject = "亲爱的专家"+dietitian.getDname() + "您的的方案有新的会员购买";
                break;
            case "cancelOrder": break;
            case "timeout": break;
            default:break;
        }
        String [] mail = new String[2];
        mail[0] = subject;
        mail[1] = MailHtmlUtils.initHtml(mailMessage.toString());
        return mail;
    }
}
